Skip to content

Conversation

@dprevoznik
Copy link
Contributor

@dprevoznik dprevoznik commented Jan 27, 2026

The Gemini Computer Use API requires a URL in all function responses. Previously, the code attempted to call kernel.browsers.computer.getState() which doesn't exist in the SDK - the call would silently fail.

Changes:

  1. Removed the non-existent getState() call from screenshot()
  2. Always return 'about:blank' as the URL in both success and error cases
  3. Added readme section explaining why (Computer Controls API doesn't provide page URL)

This works because:

  • Gemini validates URL is present but relies on screenshots (couldn't find any information online about the model's usage of the url provided and it hasn't impacted my testing at all)
  • 'about:blank' is a valid browser URI that Gemini accepts
  • Tested and confirmed working with Gemini Computer Use API across python and typescript versions

Note

Ensures Computer Use function responses always include a URL and removes unsupported URL fetching.

  • Always return url: about:blank from screenshot() and on action errors in both Python and TypeScript tools; loops now include url in error function_responses
  • Remove non-existent getState calls from screenshot logic
  • Add README "Known Limitations" explaining URL reporting fallback

Written by Cursor Bugbot for commit 7674463. This will update automatically on new commits. Configure here.

… for URL

The Gemini Computer Use API requires a URL in all function responses.
Previously, the code attempted to call `kernel.browsers.computer.getState()`
which doesn't exist in the SDK - the call would silently fail.

Changes:
1. Removed the non-existent getState() call from screenshot()
2. Always return 'about:blank' as the URL in both success and error cases
3. Added comments explaining why (Computer Controls API doesn't provide page URL)

This works because:
- Gemini validates URL is present but relies primarily on screenshots
- 'about:blank' is a valid browser URI that Gemini accepts
- Tested and confirmed working with Gemini Computer Use API
@dprevoznik dprevoznik marked this pull request as ready for review January 27, 2026 18:08
@dprevoznik dprevoznik requested a review from Sayan- January 27, 2026 18:25
Copy link
Contributor

@Sayan- Sayan- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeet

@dprevoznik dprevoznik merged commit 4960398 into main Jan 27, 2026
2 checks passed
@dprevoznik dprevoznik deleted the fix/gemini-computer-use-url-in-errors branch January 27, 2026 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants